﻿using EasyTest.Application.Service.QuestionBank.Enum;

namespace EasyTest.Application.Service;

/// <summary>
/// 题目表
/// </summary>
[SugarTable(null, "题目表")]
[SysTable]
[SugarIndex("index_{table}_Q", nameof(QuestionBankId), OrderByType.Asc)]
[SugarIndex("index_{table}_C", nameof(CategoryId), OrderByType.Asc)]
[SugarIndex("index_{table}_S", nameof(Status), OrderByType.Asc)]
public partial class EtQuestion : EntityTenantBaseData
{
    /// <summary>
    /// 题库ID
    /// </summary>
    [SugarColumn(ColumnDescription = "题库ID")]
    [Required]
    public virtual long QuestionBankId { get; set; }

    /// <summary>
    /// 分类ID
    /// </summary>
    [SugarColumn(ColumnDescription = "分类ID")]
    [Required]
    public virtual long CategoryId { get; set; }

    /// <summary>
    /// 题目内容
    /// </summary>
    [SugarColumn(ColumnDescription = "题目内容", Length = 2000)]
    [Required, MaxLength(2000)]
    public virtual string Content { get; set; }

    /// <summary>
    /// 题目类型
    /// </summary>
    [SugarColumn(ColumnDescription = "题目类型")]
    [Required]
    public virtual QuestionTypeEnum QuestionType { get; set; }

    /// <summary>
    /// 选项（JSON格式）
    /// </summary>
    [SugarColumn(ColumnDescription = "选项（JSON格式）", Length = 1000)]
    public virtual string Options { get; set; }

    /// <summary>
    /// 答案
    /// </summary>
    [SugarColumn(ColumnDescription = "答案", Length = 500)]
    [Required, MaxLength(500)]
    public virtual string Answer { get; set; }

    /// <summary>
    /// 解析
    /// </summary>
    [SugarColumn(ColumnDescription = "解析", Length = 2000)]
    public virtual string Analysis { get; set; }

    /// <summary>
    /// 难度
    /// </summary>
    [SugarColumn(ColumnDescription = "难度")]
    [Required]
    public virtual DifficultyEnum Difficulty { get; set; }

    /// <summary>
    /// 分数
    /// </summary>
    [SugarColumn(ColumnDescription = "分数")]
    [Required]
    public virtual int Score { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int OrderNo { get; set; } = 100;

    /// <summary>
    /// 状态
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public StatusEnum Status { get; set; } = StatusEnum.Enable;

    /// <summary>
    /// 标签（JSON格式）
    /// </summary>
    [SugarColumn(ColumnDescription = "标签（JSON格式）", Length = 500)]
    public virtual string Tags { get; set; }

    /// <summary>
    /// 时间限制（秒）
    /// </summary>
    [SugarColumn(ColumnDescription = "时间限制（秒）")]
    public virtual int TimeLimit { get; set; }

    /// <summary>
    /// 附件（JSON格式）
    /// </summary>
    [SugarColumn(ColumnDescription = "附件（JSON格式）", Length = 1000)]
    public virtual string Attachments { get; set; }

    /// <summary>
    /// 出题人备注
    /// </summary>
    [SugarColumn(ColumnDescription = "出题人备注", Length = 1000)]
    public virtual string CreatorComments { get; set; }

    /// <summary>
    /// 跳转地址ID
    /// </summary>
    [SugarColumn(ColumnDescription = "跳转地址ID")]
    public virtual long? JumpAddressId { get; set; }

    /// <summary>
    /// 跳转地址路径
    /// </summary>
    [SugarColumn(ColumnDescription = "跳转地址路径", Length = 512)]
    public virtual string JumpAddressPath { get; set; }
}